#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int a,j,i;
    while (scanf("%d", &a) != EOF) 
    { 
        for (j=1;j<=a;j++)
        {
            for (i=1;i<=a;i++)
            {
                if (j==i)
                {
                    printf("* ");
                }
                else if (i==1||j==a)
                {
                    printf("* ");
                }
                else
                {
                    printf("  ");
                }
            }
            printf("\n");
        }
    }
    return 0;
}